<!DOCTYPE html>
<html lang="zh-CN">
<head><meta name="description" content="电子发票（预览） - 若通音乐（Ruotong Music）。页面：invoice。高品质商用音乐与音效，授权便捷，企业合作支持。"><meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>电子发票（预览）</title>
  <style>
    :root{ --brand:#2fc8a3; --border:#262b31; --muted:#6b7280;}
    *{box-sizing:border-box}
    body{margin:0;background:#0b0d0f;color:#e5e7eb;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",Arial,sans-serif}
    .sheet{width:880px;margin:30px auto;padding:28px;background:#111318;border:1px solid var(--border);border-radius:12px;box-shadow:0 6px 20px rgba(0,0,0,.06)}
    .title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
    .title h1{margin:0;font-size:22px}
    .badge{background:rgba(34,197,94,.1);color:#166534;border:1px solid rgba(34,197,94,.3);padding:4px 10px;border-radius:999px;font-weight:700}
    .grid{display:grid;grid-template-columns:1fr 1fr;gap:10px 18px;margin-top:8px}
    .cell{padding:10px 12px;background:#fbfcfd;border:1px dashed var(--border);border-radius:10px}
    .cell span{color:#6b7280;margin-right:6px}
    .actions{display:flex;gap:10px;justify-content:center;margin-top:20px}
    .btn{border:1px solid #e5e7eb;padding:8px 12px;border-radius:8px;background:#111318;cursor:pointer}
    .btn-primary{background:var(--brand);color:#fff;border-color:transparent}
    @media print{ body{background:#111318}.actions{display:none}.sheet{box-shadow:none;border:none;margin:0;width:auto} }
  </style>

<!-- SEO 多语言模板：将 href 替换为实际三语路径 -->
<link rel="alternate" hreflang="zh" href="/zh/" />
<link rel="alternate" hreflang="en" href="/en/" />
<link rel="alternate" hreflang="ja" href="/ja/" />

<!-- JSON-LD 占位：为满足 CSP（script-src 'self'），请改为带 nonce/hash 的内联脚本，或由服务端注入。 -->

<meta name="theme-color" content="#000000" />
<!-- 占位：请替换为页面真实描述 --><!-- 占位：社交分享基础字段 -->
<meta property="og:type" content="website" />
<meta property="og:title" content="若通音乐素材平台" />
<meta property="og:description" content="高质量配乐与音效素材，支持试听、购买、下载授权。" />
<meta property="og:image" content="https://example.com/og-image.png" />

<!-- 占位：请替换为实际页面地址 --><link rel="canonical" href="https://example.com/" />
</head>
<body>
<style>
.skip-to-content{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;}
.skip-to-content:focus{left:16px;top:16px;width:auto;height:auto;z-index:10000;background:#fff;padding:8px 12px;border:1px solid #000;}
:focus-visible{outline:2px solid currentColor;outline-offset:2px;}
</style>
<a class="skip-to-content" href="#main">跳转到主内容</a>


  <div class="sheet" id="sheet">
    <div class="title"><h1>电子发票（申请记录）</h1><div class="badge" id="status">已申请</div></div>
    <div class="grid" id="grid"></div>
    <div class="actions"><button class="btn" onclick="window.print()">下载 / 打印</button><button class="btn btn-primary" onclick="window.close()">关闭</button></div>
  </div>
  <script>
    function qs(n){return new URLSearchParams(location.search).get(n)}
    const pid = qs("paymentId");
    const invoices = JSON.parse(localStorage.getItem("ruotong_invoices") || "{}");
    const info = invoices[pid];
    if(!info){
      document.querySelector("#sheet").innerHTML = '<div style="padding:40px;text-align:center">未找到该订单的发票申请，您可以在“发票中心”中为该订单申请发票。</div>';
    }else{
      document.querySelector("#status").textContent = info.status || "已申请";
      const grid = document.querySelector("#grid");
      const rows = [
        ["订单编号：", info.paymentId],
        ["发票金额：", "¥"+Number(info.amount||0).toLocaleString("zh-CN")],
        ["抬头类型：", info.headType],
        ["发票抬头：", info.title],
        ["税号：", info.taxNo || "—"],
        ["接收邮箱：", info.email],
        ["发票内容：", info.content || "音乐版权服务费"],
        ["申请时间：", info.appliedAt || ""],
        ["备注：", info.note || "—"]
      ];
      for(const [k,v] of rows){ const cell=document.createElement("div");cell.className="cell";cell.innerHTML=`<span>${k}</span>${v}`;grid.appendChild(cell); }
    }
  </script>

<!-- Ruotong Account Buttons (auto-wired) -->
<script>window.RUOTONG_API_BASE = window.RUOTONG_API_BASE || '/api';</script>
<link rel="stylesheet" href="/rt-assets/css/toast.css">
<link rel="stylesheet" href="/rt-assets/css/modal.css">
<script src="/rt-assets/js/toast.js" defer></script>
<script src="/rt-assets/js/modal.js" defer></script>
<script src="/rt-assets/js/account-actions.js" defer></script>


<script>
document.addEventListener('DOMContentLoaded', function(){
  try{ document.body.classList.add('rt-darkfix'); }catch(e){}
});
</script>

</body>
</html>
